package com.ly.springsolrtest.springsolr.service;

import com.ly.springsolrtest.springsolr.bo.ArticleBo;
import org.apache.solr.client.solrj.SolrServerException;

import java.io.IOException;
import java.util.List;

/**
 * @param
 * @author linweijian
 * @date 2018/3/30 12:49
 * @return
 */
public interface ArticleBoService {
    /**
     * 添加
     *
     * @param [articleBo]
     * @return void
     * @author linweijian
     * @date 2018/3/30 12:57
     */
    void save(ArticleBo... articleBo) throws IOException, SolrServerException;

    /***
     * 删除
     * @author linweijian
     * @date 2018/3/30 12:57
     * @param [id]
     * @return void
     */
    void deleteById(String id) throws IOException, SolrServerException;

    /**
     * 根据Id查找
     *
     * @param [id]
     * @return com.ly.springsolrtest.springsolr.bo.ArticleBo
     * @author linweijian
     * @date 2018/3/30 12:57
     */
    ArticleBo getArticleBoById(String id) throws IOException, SolrServerException;

    /**
     * 分页查询，高亮字段
     *
     * @param [keywords, startIndex, pageSize]
     * @return java.util.List<com.ly.springsolrtest.springsolr.bo.ArticleBo>
     * @author linweijian
     * @date 2018/3/30 13:53
     */
    List<ArticleBo> getHighlight(String keywords, int startIndex, int pageSize);
}
